# include "DenseMatrix.H"

using namespace std;
using namespace mg::numeric::algebra ;


int main() {

  matrix<int> m1 = {{11,12,0,0,0,0,0,0} ,{0,22,0,0,0,0,0,0} ,{31,32,33,0,0,0,0,0},
                              {41,42,43,44,0,0,0,0}, {0,0,0,0,55,56,0,0},{0,0,0,0,0,66,67,0},{0,0,0,0,0,0,77,78},{0,0,0,0,0,0,87,88}};
 matrix<int> m01 = {{11,12,13,14,15,16,17,18} ,{21,22,23,24,25,26,27,28} ,{31,32,33,34,35,36,37,38},
                              {41,42,43,44,45,46,47,48}, {51,52,53,54,55,56,57,58},{61,62,63,64,65,66,67,68},{71,72,73,74,75,76,77,78},{81,82,83,84,85,86,87,88}};
 

  m1.print();
  cout << "------------------------------------------------------------------------------------" <<endl;
  cout << m01;
  matrix<int> m2("input24.dat");
  
  cout << "------------------------------------------------------------------------------------" <<endl;
  cout << m2;
  
  cout << "------------------------------------------------------------------------------------" <<endl;
  matrix<double> m3 ("coo_matrix.mtx");

  cout << m3 ;
  
  cout << "------------------------------------------------------------------------------------" <<endl;
  std::vector<int> v1 =  {3,4,0,1,6,8,1,19}; 
  
  std::vector<int> v2 = m1*v1 ;

  for(auto& x : v2 )
      cout << x << " ";
  cout << endl;    
  cout << "------------------------------------------------------------------------------------" <<endl;

  matrix<double> m4("input4.dat");    
  std::vector<double> v3 =  {10,3,0,3,1,2}; 
  cout << m4;
  cout << "------------------------------------------------------------------------------------" <<endl;
  std::vector<double> v4 = m4*v3 ; 
  
  for(auto& x : v4 )
      cout << x << " ";
  cout << endl;    
  cout << "------------------------------------------------------------------------------------" <<endl;
 
  matrix<double> m5 = {{1.01,0,3.43, 0}, {0,4.07,0,0}, {0,0,0,3.09}, {1.0,2.4,0,0}} ;  
  matrix<double> m6 = {{0,0,1.21,0}, {3.31,0,0,0}, {0,0,0,-6.11}, {1.0,2.2,0,0}} ; 

  matrix<double> m7(2,2) ;
  m7 = m5*m6 ;
  cout << m7 ;
  cout << "------------------------------------------------------------------------------------" <<endl;
  matrix<double> m8(4,4) ;//= m5+m6 ;  
 // strassen(m5,m6,m8,4) ;    
  cout << m8 ;    
  cout << "------------------------------------------------------------------------------------" <<endl;
  
  m5+=m6 ;
  matrix<double> m10 = m5 * 2.0 ;
  cout << m10;
  cout << "------------------------------------------------------------------------------------" <<endl;

  matrix<int> m9 = m1*m01  ;
 // strassen(m1,m01,m9,8) ;
  cout << m9 ;
  
  cout << "------------------------------------------------------------------------------------" <<endl;
  cout << m9.exctractMinor(1,2);  
  
  cout << "------------------------------------------------------------------------------------" <<endl;
  cout << m9.det() << std::endl; 
  cout << "------------------------------------------------------------------------------------" <<endl;


  std::vector<int> v5 = m9.diag() ; 
  cout << "------------------------------------------------------------------------------------" <<endl;
  
  for(auto&x : v5)
      cout << x << ' ' ;
  cout << endl;    
  cout << "------------------------------------------------------------------------------------" <<endl;
  matrix<int> m11("input26.dat");
  cout << m11 ;
  cout << m11.det() ;
  return 0;
}



